#include <iostream>
#include <string>
#include "pool.h"

using std::string;

const size_t MAXOBJS = 10;

class MyObject
{
private:
	static Pool pool;
	string name;
	int id;

	// constructor
	MyObject(int i, const string& nm):name(nm), id(i){}
	
	//dissabling copy and assignment opperator
	MyObject(const MyObject&);
	MyObject& operator=(const MyObject&);
public:
	//friend std::ostream& operator<<(std::ostream& os, const MyObject& mo);
	int getId(){ return id; }
	string getName() { return name; }
	void * operator new(size_t size);
	static void operator delete(void * ptr);
	static MyObject* create(int id, const string& name)
	{
		return new MyObject(id, name);
	}
	string getString();
};